package com.hyl.boottest.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2023/3/16 8:58
 **/
@Controller
public class EnterContoller {


	//进入列表=》首页
	@GetMapping("/")
	public String toIndex(){
		return "index";
	}

	//进入新增页面
	@GetMapping("/toAdd")
	public String toAdd(){
		return "add";
	}

	//进入新增页面
	@GetMapping("/toModify/{id}")
	public String toModify(@PathVariable(name = "id") Integer id , Model model){
		model.addAttribute("id", id);
		return "update";
	}
}
